#/bin/bash
OPENSSL=openssl-1.1.1w

echo "安装Make编译环境"
yum -y install make gcc perl-libs
echo "下载OpenSSL安装包"
curl -O "https://www.openssl.org/source/$OPENSSL.tar.gz"
echo "解压OpenSSL安装包"
tar -zxvf $OPENSSL.tar.gz
echo "编译安装"
cd $OPENSSL
./config shared --prefix=/usr/local/openssl
make && make install
# "覆盖创建软链接"
ln -sf /usr/local/openssl/bin/openssl /usr/bin/openssl
# "设置动态库路径"
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
ldconfig
openssl version
echo "OpenSSL升级完成"
